package cn.iocoder.yudao.framework.mybatis.autotable;

import cn.iocoder.yudao.framework.mybatis.autotable.ddl.DDLGenerator;
import cn.iocoder.yudao.framework.mybatis.autotable.ddl.DDLGeneratorConfig;
import cn.iocoder.yudao.framework.mybatis.autotable.ddl.DefaultDDLGenerator;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;

public class DDLGeneratorTest {
    public static <T extends BaseDO> void test(Class<T> t) {
        // 创建配置
        DDLGeneratorConfig config = new DDLGeneratorConfig();
        config.setEngine("InnoDB");
        config.setCharset("utf8mb4");
        config.setCollation("utf8mb4_unicode_ci");
        
        // 创建生成器
        DDLGenerator generator = new DefaultDDLGenerator(config);
        // 生成DDL
        String ddl = generator.generateDDL(null, t,"auto_table",true);
        System.out.println(ddl);
    }
}